package com.yipei.business.service.impl;

import java.util.List;
import com.yipei.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yipei.business.mapper.MlAssetAccountMapper;
import com.yipei.business.domain.MlAssetAccount;
import com.yipei.business.service.IMlAssetAccountService;

/**
 * 资金账号Service业务层处理
 * 
 * @author yipei
 * @date 2024-12-23
 */
@Service
public class MlAssetAccountServiceImpl implements IMlAssetAccountService 
{
    @Autowired
    private MlAssetAccountMapper mlAssetAccountMapper;

    /**
     * 查询资金账号
     * 
     * @param id 资金账号主键
     * @return 资金账号
     */
    @Override
    public MlAssetAccount selectMlAssetAccountById(Long id)
    {
        return mlAssetAccountMapper.selectMlAssetAccountById(id);
    }

    /**
     * 查询资金账号列表
     * 
     * @param mlAssetAccount 资金账号
     * @return 资金账号
     */
    @Override
    public List<MlAssetAccount> selectMlAssetAccountList(MlAssetAccount mlAssetAccount)
    {
        return mlAssetAccountMapper.selectMlAssetAccountList(mlAssetAccount);
    }

    /**
     * 新增资金账号
     * 
     * @param mlAssetAccount 资金账号
     * @return 结果
     */
    @Override
    public int insertMlAssetAccount(MlAssetAccount mlAssetAccount)
    {
        mlAssetAccount.setCreateTime(DateUtils.getNowDate());
        return mlAssetAccountMapper.insertMlAssetAccount(mlAssetAccount);
    }

    /**
     * 修改资金账号
     * 
     * @param mlAssetAccount 资金账号
     * @return 结果
     */
    @Override
    public int updateMlAssetAccount(MlAssetAccount mlAssetAccount)
    {
        mlAssetAccount.setUpdateTime(DateUtils.getNowDate());
        return mlAssetAccountMapper.updateMlAssetAccount(mlAssetAccount);
    }

    /**
     * 批量删除资金账号
     * 
     * @param ids 需要删除的资金账号主键
     * @return 结果
     */
    @Override
    public int deleteMlAssetAccountByIds(Long[] ids)
    {
        return mlAssetAccountMapper.deleteMlAssetAccountByIds(ids);
    }

    /**
     * 删除资金账号信息
     * 
     * @param id 资金账号主键
     * @return 结果
     */
    @Override
    public int deleteMlAssetAccountById(Long id)
    {
        return mlAssetAccountMapper.deleteMlAssetAccountById(id);
    }
}
